package com.code
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.filters.GlowFilter;

	/**
	 *单张牌
	 * @author zqp
	 * 
	 */	
	public class Card extends Sprite
	{
		public static const CARD_WIDTH:int = 70;
		public static const CARD_HEIGHT:int = 95;
		
		private var _cardNum:int = 0;
		private var _cardType:int = 0;
		
		public var bitmapData:BitmapData;
		
		public function Card()
		{
			super();
			bitmapData = new BitmapData(Card.CARD_WIDTH,Card.CARD_HEIGHT);
			addChild(new Bitmap(bitmapData));
			this.addEventListener(MouseEvent.MOUSE_OVER,onMouseOverListener,false,0,true);
			this.addEventListener(MouseEvent.MOUSE_OUT,onMouseOutListener,false,0,true);
		}
		/**
		 *牌值 
		 */
		public function get cardNum():int
		{
			return _cardNum;
		}

		/**
		 * @private
		 */
		public function set cardNum(value:int):void
		{
			_cardNum = value;
		}

		/**
		 *牌类型  黑红梅方 
		 */
		public function get cardType():int
		{
			return _cardType;
		}

		/**
		 * @private
		 */
		public function set cardType(value:int):void
		{
			_cardType = value;
		}
		private function onMouseOverListener(event:MouseEvent):void
		{
			this.filters = [new GlowFilter(0x00ff00)];
		}
		private function onMouseOutListener(event:MouseEvent):void
		{
			this.filters = null;
		}

	}
}